//
//  FastPageCtr.swift
//  Pods
//
//  Created by zhu xietong on 2017/8/8.
//
//

import Foundation
import Eelay

open class FastPageCtr: SoPageController {
    
    public convenience init(contorllers:UIViewController...) {
        self.init()
        self.controllers = controllers
    }
    
    
    public required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    open override func viewDidLoad() {
        super.viewDidLoad()
    }
    
    open func observerPorgress(value:String){
        
    }
    
    open override func place(menu: UIView, contentView: UIScrollView) {
        var ui = SoSegBarStyle()
        let count:CGFloat = CGFloat(self.controllers.count)        
        ui.indicator_color = UIColor(shex: UIColor.main_hex)
        ui.normal_color = UIColor(shex: "#666")
        ui.select_color = UIColor(shex: UIColor.main_hex)
        ui.seg_width = Swidth/count
        ui.indicator_width = Swidth/count
        
        if let bar = menuBar as? SoSegBar{
            
            bar.progressObserver = {_ in}
            
            //            bar.segClass = IndicatorButton.self
            let line = UIView()
            let blur = UIBlurEffect.blurView(whith: .extraLight)
            blur.eelay = [
                [line,[ee.L.B.R],"0.6"],
            ]
            line.backgroundColor = UIColor(shex: "#cccccc")
            bar.backgroundView = blur
            bar.ui = ui
        }
        
        
        menu.frame = [0,TP.topHeight,Swidth,44]
        //        self.navigationItem.titleView = menu
        self.view.addSubview(menu)
        let av = UIView()
        jo_contentView.eelay = [
            [av,[ee.T.L.R],"44"],
            [contentView,[ee.L.B.R],[av,ee.B,ee.T]]
        ]
    }
    
}





